<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //Iterator的作用
        //遍历器（迭代器）用来遍历的
        //使用
        //     const it = [1, 2][Symbol.iterator]()//    console.log(it.next()); //{value: 1, done: false}
        //       console.log(it.next()); //{value: 1, done: false}
        //    console.log(it.next()); //{value: undefined, done: true}
        //it可遍历对象(可迭代器)
        //Symbol.iterator:可遍历对象的生成方法
        //什么是iterator？
        //Symbol.iterator(可遍历对象生成的方法)->it(可遍历对象)->it.next()->...(直到done为true)
    </script>
</body>

</html>